$(document).ready(function() {
	$('#searchFormSubmit').click(function() {
		var jsonData = {
				fromDate : $("input#fromDate").val(),
				toDate : $("input#toDate").val(),
				
				employee : $("#employee").val(),
				leadStatus : $("#leadStatus").val()
		};
	    alert('Handler for .submit() called.'+jsonData);
	    
	    var fromDate=$("input#fromDate").val();
	    var toDate=$("input#toDate").val();
	    var employee=$("#employee").val();
	    var leadStatus=$("#leadStatus").val();
	    
	    var newUrl = "leadSearch?fromDate="+ fromDate + "&toDate=" + toDate + "&employee=" + employee + "&leadStatus=" + leadStatus;
		leadTable.fnReloadAjax(newUrl);
	  //  var newUrl = "search/leadsList?searchResults="+JSON.stringify(jsonData)+"";
	  //  alert(newUrl);
	  //  leadTable.fnReloadAjax(newUrl);
	});
	
	$('#datepicker').datetimepicker({
	      pickTime: false
    });
	
	$('#datepicker2').datetimepicker({
	      pickTime: false
	});
	
	$.fn.datetimepicker.defaults = {
			  maskInput: true,           // disables the text input mask
			  pickDate: true,            // disables the date picker
			  pickTime: true,            // disables de time picker
			  pick12HourFormat: false,   // enables the 12-hour format time picker
			  pickSeconds: true,         // disables seconds in the time picker
			  startDate: -Infinity,      // set a minimum date
			  endDate: Infinity          // set a maximum date
			};
});